// import request from '@/utils/request'
import fetch2 from '@/utils/fetch2'

export function loginByUsername(username, password) {
  const data = {
    username,
    password
  }
  // return request({
  return fetch2({
    url: '/api/login/login',
    method: 'post',
    data: data
  })
}

export function loginByRemote() {
  return fetch2({
    url: '/api/login/login',
    method: 'post'
  })
}

export function logout() {
  // return request({
  return fetch2({
    url: '/api/login/logout',
    method: 'post'
  })
}

export function getUserInfo(token) {
  // return request({
  return fetch2({
    url: '/api/user/info',
    method: 'get',
    params: { token }
  })
}

